package edu.mbb.cloud.nacos;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnProperty(name = "spring.mbb.enable",matchIfMissing = true)
public class ConfigBootstrapConfiguration {
    @Bean
    @ConditionalOnMissingBean
    public MbbConfigProPerties mbbConfigProPerties(){
        return  new MbbConfigProPerties();
    }


    @Bean
    public MbbPropertySourceLocator mbbPropertySourceLocator(
            MbbConfigProPerties mbbConfigProPerties) {
        return new MbbPropertySourceLocator(mbbConfigProPerties);
    }

}
